package unimelb.discussiontracker.twitter.data.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "HashTag")
@NamedQueries(value = { @NamedQuery(name = "HashTag.FindByValue", query = "SELECT tag FROM HashTagEntity tag WHERE tag.value = :value") })
public class HashTagEntity {
    @Id
    @GeneratedValue
    @Column(name = "Id")
    private long id;

    @Column(name = "Value")
    private String value;

    @OneToMany(mappedBy = "hashTag", cascade = CascadeType.ALL)
    private List<TweetHashTagAssociation> includingTweets;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public List<TweetHashTagAssociation> getIncludingTweets() {
        return includingTweets;
    }

    public void setIncludingTweets(List<TweetHashTagAssociation> includingTweets) {
        this.includingTweets = includingTweets;
    }

}
